<template>
    <fieldset>
        <legend>登入</legend>
        用户名:
        <input type="text" v-model= "username">
        <br />
        密码:
        <input type="text" v-model="password" @keydown.enter="login">
        <br>
        <button @click="login">登入</button>
    </fieldset>
</template>
<script>
import * as api from "@/api"
export default{
    data(){
        return{
            username:"",
            password:"",
        }
    },
    methods:{
        login(){
            let params = {
                username:this.username,
                password:this.password
            }
            api.loginApi(params)
                .then(res =>{
                    console.log(res);
                })
        }
    }
}
</script>
















